package com.example.util;

import com.example.domain.Message;
import com.google.gson.Gson;

import java.util.HashSet;
import java.util.Set;

public class MessageUtil {
    public static String getMessage(String from, String to, String text, Set<String> set){
        Message message = new Message(from, to, text, set);
        Gson gson = new Gson();
        return gson.toJson(message);
    }
    public static Message fromMessage(String messsage){
        Gson gson = new Gson();
        return gson.fromJson(messsage,Message.class);
    }
}
